import threading, time


def say(num):
    print("正在运行:%s"%num)
    time.sleep(3)

# 创建线程实例   参数需要元组,注意:元组中只有一个元素时直接是int,不是元组,需要加逗号
thread01 = threading.Thread(target=say, args=(1,))
thread02 = threading.Thread(target=say, args=(2,))
# 启动线程
thread01.start()   # 方法执行完会自动结束
thread02.start()
print(thread01.getName())  # 获取线程名

